SRCS1 := $(wildcard *.c)
SRCS2 := $(wildcard *.S)
OBJS1 := $(patsubst %.c,%.o,$(SRCS1)) 
OBJS2 := $(patsubst %.S,%.o,$(SRCS2))  

UNAME := $(shell uname)
ifeq ($(UNAME), Linux)
	RM = rm -f
	FixPath = $1
else
	RM = del /Q
	FixPath = $(subst /,\,$1)
endif

.PHONY : all
all : $(OBJS1) $(OBJS2)

$(OBJS1) : %.o : %.c
	gcc -c $< $(CFLAG)

$(OBJS2) : %.o : %.S
	gcc -c $< $(CFLAG)

.PHONY : build
build: $(OBJS1)
	gcc bignum.o rsa.o main.o -o main

.PHONY : clean
clean : 
	$(RM) *.o